<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        //外层循环一次，内层循环全部

        // 打印几行几列小星星
        var rows = prompt('请问打印几行小星星？');
        var cols = prompt('请问打印几列小星星？');
        for( i = 0; i< rows ; i++){
            // console.log('---');
            var star = '';
            for(j = 0 ; j<cols ; j++){
               star = star+'*';
            }
            console.log(star);
        }
       
       
    </script>
</body>

</html>